<template>
	<view>
		<u-popup v-model="show" mode="bottom" borderRadius="20" closeable @close="close">
			<view class="tc p20 pt40">
				<view class="pb20 fs30 fw-w">请输入支付密码</view>
				<view class="tr pb20">
					<text class="color-666" @click="$jump('/pages/my/set/payPsdSet')">设置支付密码</text>
				</view>
				<u-message-input :maxlength="6" dot-fill @change="change" @finish="finish" :focus="focus" />
			</view>
		</u-popup>
	</view>
</template>

<script>
	// <password @finish="finish" />
	export default {
		name: "password",
		props: {
			value: {
				type: Boolean,
				default: false
			}
		},
		data() {
			return {
				show: false,
				focus: false
			};
		},
		methods: {
			open(e) {
				this.show = true
				setTimeout(() => this.focus = true, 300)
				if (this.$user.is_trade_pwd===0)  {
					this.$msg('请先设置密码')
					setTimeout(()=>{
						this.$jump('/pages/my/set/payPsd')
					},1000)
				}
			},
			close() {
				this.focus = false
				this.$emit('input', this.show)
			},
			change(e) {
				this.$emit('input', e)
			},
			finish(e) {
				this.$emit('finish', e)
				this.show = false
			},
		}
	}
</script>

<style lang="scss">

</style>